Skip to content

BDMS 111: location updates & other#137

Merged
jirhiker merged 29 commits into
stagingfrom
jab-location-transfer-updates
Sep 15, 2025
Merged

BDMS 111: location updates & other#137
jirhiker merged 29 commits into
stagingfrom
jab-location-transfer-updates

Conversation

@jacob-a-brown

@jacob-a-brown jacob-a-brown commented Sep 15, 2025

Copy link
Copy Markdown
Contributor

Why

This PR addresses the following problem / context:

  • tests should be run on PRs for update branch names (production and staging)
  • updates to the location model needed to be incorporated into the transfer script
  • elevation needed to be separated from point for a location
  • datetime records are stored in UTC
  • lookup table codes/values needed to be transferable and interoperable with lexicon terms

How

Implementation summary - the following was changed / added / removed:

  • Updated transfer script for new fields
  • Converted elevation to meters if exists, else retrieved from EPQS
  • queried outside sources for a location's state, county, and quand_name fields using a location's point x/y values
  • made mapper from a lookup table's code to meaning so that the values can be transferred and interoperable with lexicon terms. because many codes are the same between tables they are prepended with the table name to ensure uniqueness (e.g. LU_CoordinateAccuracy:M is a key in the table as well as LU_SiteType:M)
  • In data transfers all datetime values are converted to UTC. If a time is midnight (12:00:00 AM or 00:00:00) the time doesn't change but the time zone is set to UTC

Notes

Any special considerations, workarounds, or follow-up work to note?

  • name was removed from Location until further consideration and debate
  • many utilities used in transfers/util.py are applicable and used throughout the API, so they were moved to services/util.py for repo-wide access
  • updated SRID to use constants from constants.py for style
  • NM_Aquifer CoordinateAccuracy values are not yet transferred. AMP needs to be consulted before this transfer is made.

@codecov-commenter

codecov-commenter commented Sep 15, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.89908% with 23 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
services/util.py 56.86% 22 Missing ⚠️
tests/test_collabnet.py 66.66% 1 Missing ⚠️
Files with missing lines Coverage Δ
api/geospatial.py 97.50% <100.00%> (ø)
api/location.py 93.18% <100.00%> (ø)
constants.py 100.00% <100.00%> (ø)
db/group.py 100.00% <100.00%> (ø)
db/location.py 94.87% <100.00%> (ø)
schemas/location.py 92.72% <100.00%> (ø)
services/geospatial_helper.py 72.09% <100.00%> (ø)
services/location_helper.py 100.00% <100.00%> (ø)
tests/conftest.py 100.00% <ø> (ø)
tests/test_geospatial.py 87.87% <100.00%> (ø)
... and 3 more

Comment thread db/group.py
@@ -28,7 +29,7 @@ class Group(Base, AutoBaseMixin, ReleaseMixin):
description: Mapped[str] = mapped_column(String(255), nullable=True)
name: Mapped[str] = mapped_column(String(100), nullable=False, unique=True)
project_area: Mapped[Optional[WKBElement]] = mapped_column(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename to region_of_interest (?)

@jirhiker jirhiker merged commit 98ac4ac into staging Sep 15, 2025
3 checks passed
@TylerAdamMartinez TylerAdamMartinez deleted the jab-location-transfer-updates branch February 5, 2026 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants